home *** CD-ROM | disk | FTP | other *** search
/ Experimental BBS Explossion 3 / Experimental BBS Explossion III.iso / c / kafsort.zip / SORT.DOC < prev    next >
Text File  |  1993-05-29  |  6KB  |  237 lines

  1. SORT - Record Sorting System
  2.  
  3.  
  4.  
  5. SORT IS PART OF THE KAFS SYSTEM
  6.  
  7.  
  8.  
  9. KAFS (INCLUDING SORT) IS SHAREWARE AND MUST BE REGISTERED AFTER
  10.                      A 30 DAY TRIAL PERIOD.
  11.  
  12.  
  13.  
  14. The Record Sorting System (SORT) is an interface program
  15. designed to sort records that are extracted from data files.
  16. SORT allows the data file(s) to remain in their original form
  17. while sorting by 'tags' associated with each record. SORT works
  18. with fixed length records that are associated with a record
  19. address. SORT has many advantages over other sorting methods
  20. such as reduced sorting times, data integrity, multiple file
  21. data merging and other features.
  22.  
  23.  
  24.  
  25. Using SORT is very easy. Just include the source code module (or
  26. related object file) in your compilation and adhere to the
  27. interface calling conventions described in the SORT Interface
  28. Specs section. A sample program SORTEST.C  is included in both
  29. source code and its compiled counterpart SORTEST.EXE. Review the
  30. source code for this sample program and run the program. Doing
  31. that will present the 'C' programmer with a clearer picture than
  32. multitudes of description in written form. 
  33.  
  34.  
  35.  
  36.  
  37.  
  38. REMEMBER THAT KAFS IS SHAREWARE! YOU ARE ALLOWED TO USE AND
  39. REVIEW THIS SYSTEM FOR 30 DAYS AFTER WHICH TIME YOU ARE REQUIRED
  40. TO REGISTER THIS SOFTWARE.
  41.  
  42.  
  43. KAFS, Version 2.0 - REGISTRATION
  44.  
  45.  
  46.  
  47. Copyright 1991 - 1993, Dimestore Software
  48.  
  49. All rights reserved
  50.  
  51.  
  52.  
  53. You can order or register Dimestore Software products by check
  54. or money order.
  55.  
  56.  
  57.  
  58. TO:                    FROM:
  59.  
  60. Dimestore Software         Name: _______________________________________
  61.  
  62. 23121 Verdugo Dr. Suite 202
  63.  
  64. Laguna Hills, CA 92653    (Company):_______________________________________
  65.  
  66.  
  67. 714-581-6749 Voice       (Title):_______________________________________
  68.  
  69.  
  70.                           Address: _______________________________________
  71.  
  72. Today's          
  73.  
  74. date: ___________     City, State:_______________________________________
  75.  
  76.                                                                     Zip Code
  77.  
  78.                      Phone Number: _____________________________
  79.  
  80.  
  81.  
  82. KAFS System  for MS-DOS
  83.  
  84.  
  85.   You will receive:
  86.  
  87.   1.  A full production Release of the product 
  88.   2.  A Printed Manual
  89.   3.  All Related Source Code (including KAUTIL)
  90.   4.  Source Code for DDWIN - Developer's Windows system
  91.  
  92.  
  93. Diskette format (choose one) 5.25" disk ____       3.5" disk ____
  94.  
  95.  
  96.     Diskette with programs and documentation files           $39.95
  97.  
  98.                              Shipping & handling              4.95
  99.  
  100. California residents add 7.75% sales tax    ($3.10)    
  101.  
  102.                                                 Total enclosed    ________
  103.  
  104.  
  105.  
  106. Terms:
  107.  
  108. Check or Money Order drawn on a USA Bank in US funds.  Corporate
  109. Purchase orders (net 30) accepted for software from large
  110. corporations within the USA & Canada.  All licenses must be prepaid.
  111.  
  112.  
  113. Sort Interface Specs
  114.  
  115.  
  116.  
  117.  
  118.  
  119. InitSort(int taglength)  -  Must be called to initialize the
  120. sort package. An error occurs when there is not enough memory
  121. available.  There must be a minimum of 10,240 bytes available
  122. for a sort / merge buffer.
  123.  
  124. RETURNS: OK or SORTERROR
  125.  
  126.  
  127.  
  128. Sort(char *SortString, long RecordPosition) - Pass the sort tag
  129. and record pointer to the sort module.
  130.  
  131. RETURNS: OK or SORTERROR
  132.  
  133.  
  134.  
  135. Merge(void) -  Merges the sortblocks that were written to disk
  136. (if any).
  137.  
  138. RETURNS: OK or SORTERROR
  139.  
  140.  
  141.  
  142. Fetch(void) - Returns the next sorted order tag's record (file)
  143. position. When the end of sorted records is reached Fetch()
  144. returns FETCHEND (-1) indicating the end of sorted records.
  145.  
  146. RETURNS: Records file position (long) or SORTERR or FETCHEND.
  147. The sort 'TAG' is returned in the 'fetchtag' variable.
  148.  
  149.  
  150.  
  151. Endsort(void) - Ends a sort process. Releases memory and
  152. resources.
  153.  
  154. RETURNS: Nothing
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162. SORT ERROR CODES:
  163.  
  164. 1  InitSort failed - Not enough memory
  165. 2  Unable to Open/Create Sort File
  166. 3  ERROR Writing to Sort File
  167. 4  Unable to Open/Create Merge File
  168. 5  Not enough memory for Merge
  169. 6  Error reading Sort Tag for Merge
  170. 7  Error Writing to Merge File
  171. 8  Error Reading Fetch File
  172. 9  Sort Tag Length Exceeds Maximum
  173.  
  174.  
  175. SORT Technical Notes
  176.  
  177.  
  178.  
  179. A SORT 'TAG' is any string that is comprised of any number of
  180. fields or identifying information about a record or sort element.
  181.  
  182.  
  183.  
  184. All sort tags must be character strings.  Numerics must be
  185. converted to strings before calling the sort package.  All sorts
  186. are done in ascending order. All returns of SORTERROR are
  187. further qualified by the global variable 'sorterror'. All
  188. sorting should follow the order of INITSORT, SORT, MERGE, FETCH,
  189. ENDSORT.
  190.  
  191.  
  192.  
  193. SORT is very memory efficient. It can function in as little as
  194. 10 Kbytes of memory.
  195.  
  196.  
  197.  
  198. Multiple files can be sorted and fetched by adding the file# to
  199. the sort tag and using this during fetch. 
  200.  
  201.  
  202.  
  203. When passing the file to generate sort tags select desired
  204. records and only pass these to the sort.
  205.  
  206.  
  207.  
  208. SORT uses 2 temporary sort files if sort space requirements
  209. exceed memory buffers. These temporary files are dynamically
  210. generated and deleted. All temporary files are released by the
  211. ENDSORT function. Temporary files are DOS created 'Temp' files
  212. with a $$$ extension.
  213.  
  214.  
  215.  
  216. The source code is written for the TURBO C compiler, but can be
  217. easily converted to other compilers. 
  218.  
  219.  
  220.  
  221. There are 2 global variables of significance to the application:
  222.  
  223. sorterror - Contains the error code of the last sort error.
  224.  
  225. fetchtag - contains sort tag of record last fetched.
  226.  
  227.  
  228.  
  229. SORT is network compatible.
  230.  
  231.  
  232.  
  233. ** See the SORTEST.C program for examples of SORT usage.
  234.  
  235.  
  236.  
  237.